/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cbs.management.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Khuong Dao
 */
@Entity
@Table(name = "staff_request")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StaffRequest.findAll", query = "SELECT s FROM StaffRequest s"),
    @NamedQuery(name = "StaffRequest.findById", query = "SELECT s FROM StaffRequest s WHERE s.id = :id"),
    @NamedQuery(name = "StaffRequest.findByDateCreate", query = "SELECT s FROM StaffRequest s WHERE s.dateCreate = :dateCreate"),
    @NamedQuery(name = "StaffRequest.findByStaffId", query = "SELECT s FROM StaffRequest s WHERE s.staffId = :staffId"),
    @NamedQuery(name = "StaffRequest.findByReason", query = "SELECT s FROM StaffRequest s WHERE s.reason = :reason"),
    @NamedQuery(name = "StaffRequest.findByStatus", query = "SELECT s FROM StaffRequest s WHERE s.status = :status"),
    @NamedQuery(name = "StaffRequest.findByEndDate", query = "SELECT s FROM StaffRequest s WHERE s.endDate = :endDate")})
public class StaffRequest implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "date_create")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateCreate;
    @Basic(optional = false)
    @Column(name = "staff_id")
    private int staffId;
    @Basic(optional = false)
    @Column(name = "reason")
    private String reason;
    @Basic(optional = false)
    @Column(name = "status")
    private int status;
    @Basic(optional = false)
    @Column(name = "end_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date endDate;

    public StaffRequest() {
    }

    public StaffRequest(Integer id) {
        this.id = id;
    }

    public StaffRequest(Integer id, Date dateCreate, int staffId, String reason, int status, Date endDate) {
        this.id = id;
        this.dateCreate = dateCreate;
        this.staffId = staffId;
        this.reason = reason;
        this.status = status;
        this.endDate = endDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDateCreate() {
        return dateCreate;
    }

    public void setDateCreate(Date dateCreate) {
        this.dateCreate = dateCreate;
    }

    public int getStaffId() {
        return staffId;
    }

    public void setStaffId(int staffId) {
        this.staffId = staffId;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StaffRequest)) {
            return false;
        }
        StaffRequest other = (StaffRequest) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.cbs.management.model.StaffRequest[ id=" + id + " ]";
    }
    
}
